package com.ebix.sample.business;

import com.ebix.sample.dao.CotacaoDAO;
import com.ebix.sample.excetion.WisException;
import com.ebix.sample.to.CotacaoTO;
import com.ebix.sample.to.RetornoCotacaoTO;

/**
 * this is a Business Object example
 * 
 * @author Ebix L.A.
 * 
 */
public class CotacaoBO {

	public RetornoCotacaoTO calcular(CotacaoTO cotacao) throws WisException {
		RetornoCotacaoTO ret = new RetornoCotacaoTO();
		if(cotacao.getCorretor()!=null)//pretending some logic
			ret.setValue(1250.25);
		new CotacaoDAO().salvarCotacao(cotacao);//and saving the quote
		ret.setId(cotacao.getId());
		return ret;
	}
}
